class PersonC {

  constructor(user){
    ({
      name: this._name,
      sex: this.sex,
      birthday: this.birthday,
      identify: this.identify
    } = user)
  }
  get name(){
    return this._name + ' 通过getter获取'
  }
  set name(newName){
    console.log('通过setter设置name属性'+ value);
    this._name = newName
  }
  say(msg){
    console.log(`个人信息：${this.name}，性别：${this.sex}`)
    console.log('说话：',msg);
  }
}

let person = new PersonC({
  name: '张三',
  sex: '男',
  birthday: '1990-01-01',
  identify: '身份证123456'
})

console.log(person.name) // 通过getter获取
// console.log(person.setname('李四'))
// console.log(person.getname());




